package com.hanson.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hanson.common.bean.OrderCount;
import com.hanson.entity.OrderBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface OrderBeanMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(OrderBean record);

    OrderBean selectByPrimaryKey(Integer id);

    List<OrderBean> selectAll();

    int updateByPrimaryKey(OrderBean record);

    int updateAddresById(OrderBean record);

    List<OrderBean> selectByOpenId(@Param("openId") String openId, @Param("status") int status);

    List<OrderBean> selectByOrderId(@Param("orderId") String orderId);

    int updateStatusByOrderId(@Param("status") int status, @Param("orderId") String orderId);

    int updatePayPrice(@Param("status") int status, @Param("payPrice") int payPrice, @Param("id") int id);

    int updateGroupPayPrice(@Param("groupNum") String groupNum, @Param("status") int status, @Param("payPrice") int payPrice, @Param("id") int id);

    int updateStautsByGroupNum(@Param("status") int status, @Param("groupNum") String groupNum);

    List<Map<Integer, Integer>> groupByStatus(@Param("openId") String openId);

    List<OrderCount> countByOpenId(@Param("openId") String openId, @Param("time") String time);

    List<OrderBean> listOrder(Page<OrderBean> pageInfo, @Param("orderBean") OrderBean orderBean);

    List<OrderBean> statisOrders();

    int updatePayTypeByOrderSeq(@Param("payType") int payType, @Param("orderSeq") String orderSeq);

    int deleteByOrderId(@Param("orderId") String orderId);

    long countByGroupNum(@Param("groupNum") String groupNum);
}